'use strict';

const {
	log
} = require("console");

const db = uniCloud.database();
exports.main = async (event, context) => {
	let _id = event._id
	delete event["_id"]
	if(!_id){
		return {code:400 , message:"更新失败" , _id:_id || "没有"}
	}else{
		let res = await db.collection('painai').where({_id:_id}).update(event)
		return {code:200 , message:"更新成功"}
	}

	// return "著那是没写"

	//访问微信云数据库
	//1.调用获取默认环境的数据库的引用：
};
